package LEX;

import java.util.Iterator;
import java.util.List;
import java.util.Set;
import java.util.function.Function;
import java.util.stream.Stream;
import java.util.stream.StreamSupport;

public class Queryable<T> implements Iterable<T> {
    private Stream<T> stream;

    public static <S> Queryable<S> From(Iterable<S> source) {
        Queryable<S> query = new Queryable<>();
        query.stream = StreamSupport.stream(source.spliterator(), false);
        return query;
    }

    public Queryable SelectMany(Function<T, Iterable> selector) {
        return null;
    }

    public <S> Queryable<S> Select(Function<T, S> selector) {
        return null;
    }

    public Queryable<T> Where(Function<T, Boolean> predicate) {
        return null;
    }

    public List<T> toList() {
        return null;
    }

    public int Count(Function<T, Boolean> predicate) {
        return 0;
    }

    public <S> S Sum(Function<T, S> selector)
    {
        return null;
    }

    public <T> T FirstOrDefault(Function<T, Boolean> predicate)  {
        return null;
    }

    @Override
    public Iterator<T> iterator() {
        return null;
    }

    public Set<T> toSet() {
        return null;
    }
}
